<%@page import="dier.xuanke"%>
<%@ page import="java.util.*" %>
<%@ page language="java" contentType="text/html; charset=UTF-8"

    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<body>
<%
String Name=null;
String pwd=null;
String kind=null;
try
{Name=request.getParameter("Name");}
catch(Exception e){}
	try
	{pwd=request.getParameter("pwd");}
	catch(Exception e){}
	try
	{kind=request.getParameter("kind");}
	catch(Exception e){}
	xuanke xk=new xuanke();
	if(kind.equals("学生"))
	{
		if(xk.denglucheck(Name, pwd, 1)==1)
		{
			%>
			<form action="Student.jsp" method="get">
			<button name="tid" value=<%=Name%> type="submit">登录</button>
			</form>
			<%
		}
		else
		{
			%>
			<script type="text/javascript" >0
			alert("账号或者密码错误");         //弹出提示框输出错误信息
			window.location='login.jsp' ;     //跳转到登录界面
			</script>
			<%
		}	
	}
	if(kind.equals("老师"))
	{
		if(xk.denglucheck(Name, pwd, 2)==1)
		{
			%>
			<form action="Teacher.jsp" method="get">
			<button name="tid" value=<%=Name%> type="submit">登录</button>
			</form>
			<%
		}
		else
		{
			%>
			<script type="text/javascript" >0
			alert("账号或者密码错误");         //弹出提示框输出错误信息
			window.location='login.jsp' ;     //跳转到登录界面
			</script>
			<%
		}	
	}
	if(kind.equals("系统管理员"))
	{
		if(pwd.equals("2665410029"))
		{
			%>
			<form action="Root.jsp" method="get">
			<button name="tid" value=<%=Name%> type="submit">登录</button>
			</form>
			<%
		}
	}
%>
</body>
</html>